from game import zz_game
from zz import zz_log, zz_img

log = zz_log.of()


class Game(zz_game.ZZ_Game):
    def __init__(self, d, has_prize=True):
        super().__init__(d, has_prize)

    def get_name(self):
        return "小小英雄"

    def game_alert(self):
        self.alert_close_by_file("./game/img/小小英雄")

    def handle_main(self):
        self.log_msg("等待进入游戏主界面")
        self.img_exit('./game/img/小小英雄/game_main.png', 100)
        self.log_msg("已进入游戏主界面")

        self.game_alert()

        self.log_msg("开始刷怪")
        while not self.fu_check(1):
            self.game_alert()
            self.log_msg("刷怪中")
            self.d.sleep(10)

        self.get_fu()

        return True
